import Vue from 'vue'
import App from './App.vue'
import store from './store'
import router from './router'

import 'normalize.css/normalize.css' // A modern alternative to CSS resets
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'

import '@/assets/icons' // icon
import '@/permission' // permission control
import i18n from './lang' // Internationalization
// 原型链函数
import prototypeFun from './utils/prototypeFun'
import './plugins/element'

import directive from './directive'
import iconPicker from 'e-icon-picker'
// import "e-icon-picker/dist/symbol.js"; //基本彩色图标库
import 'e-icon-picker/dist/index.css'; // 基本样式，包含基本图标
import 'font-awesome/css/font-awesome.min.css'; //font-awesome 图标库
import 'element-ui/lib/theme-chalk/icon.css'; //element-ui 图标库
import RightToolbar from "@/components/RightToolbar"
import Pagination from "@/components/Pagination";

// 富文本及样式
import VueQuillEditor from 'vue-quill-editor'
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'
import '@/assets/styles/element-variables.scss'
import '@/assets/styles/index.scss' // global css
import '@/assets/styles/cloud.scss' // cloud css
// 全局注册自定义组件（遍历注册组件）
import components from '@/componentsGlobal'

Vue.use(prototypeFun)

// 时间格式化工具
window.moment = require('moment')

// 引入自定义事件
Vue.use(directive)
// 自定义表格工具扩展
Vue.component('RightToolbar', RightToolbar)
// 自定义分页全局组件挂载
Vue.component('Pagination', Pagination)

// 图标选择器
Vue.use(iconPicker, {
  FontAwesome: true,
  ElementUI: true,
  eIcon: false,
  eIconSymbol: false
})

// 富文本
Vue.use(VueQuillEditor, {
  placeholder: "输入内容"
})

// set ElementUI lang to EN
// Vue.use(ElementUI, { locale })
// 如果想要中文版 element-ui，按如下方式声明
Vue.use(ElementUI)

Object.keys(components).forEach(key => Vue.component(key, components[key]))

//阻止生产消息
Vue.config.productionTip = false

window.$vm = new Vue({
  el: '#app',
  router,
  store,
  i18n,
  render: h => h(App)
})
